home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / Install / program files / Borland / BDS / 3.0 / Objrepos / DelphiDotNet / ComponentTemplate.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2004-10-22  |  2.1 KB  |  92 lines

  1. unit [!UnitName];
  2.  
  3. interface
  4.  
  5. uses
  6.   System.Drawing, System.Collections, System.ComponentModel;
  7.  
  8. type
  9. [!if=(AncestorName, "<NONE>")]
  10.   T[!ClassName] = class(System.ComponentModel.Component)
  11. [!else]
  12.   T[!ClassName] = class([!AncestorName])
  13. [!endif]
  14.   {$REGION 'Designer Managed Code'}
  15.   strict private
  16.     /// <summary>
  17.     /// Required designer variable.
  18.     /// </summary>
  19.     Components: System.ComponentModel.Container;
  20.     /// <summary>
  21.     /// Required method for Designer support - do not modify
  22.     /// the contents of this method with the code editor.
  23.     /// </summary>
  24.     procedure InitializeComponent;
  25.   {$ENDREGION}
  26.   strict protected
  27.     /// <summary>
  28.     /// Clean up any resources being used.
  29.     /// </summary>
  30.     procedure Dispose(Disposing: Boolean); override;
  31.   private
  32.     { Private Declarations }
  33.   public
  34.     constructor Create; overload;
  35.     constructor Create(Container: System.ComponentModel.IContainer); overload;
  36.   end;
  37.  
  38. implementation
  39.  
  40. uses
  41.   System.Globalization;
  42.  
  43. {$AUTOBOX ON}
  44.  
  45. {$REGION 'Windows Form Designer generated code'}
  46. /// <summary>
  47. /// Required method for Designer support - do not modify
  48. /// the contents of this method with the code editor.
  49. /// </summary>
  50. procedure T[!ClassName].InitializeComponent;
  51. begin
  52.   Self.Components := System.ComponentModel.Container.Create;
  53. end;
  54. {$ENDREGION}
  55.  
  56. constructor T[!ClassName].Create;
  57. begin
  58.   inherited Create;
  59.   //
  60.   // Required for Windows Form Designer support
  61.   //
  62.   InitializeComponent;
  63.   //
  64.   // TODO: Add any constructor code after InitializeComponent call
  65.   //
  66. end;
  67.  
  68. constructor T[!ClassName].Create(Container: System.ComponentModel.IContainer);
  69. begin
  70.   inherited Create;
  71.   //
  72.   // Required for Windows Form Designer support
  73.   //
  74.   Container.Add(Self);
  75.   InitializeComponent;
  76.   //
  77.   // TODO: Add any constructor code after InitializeComponent call
  78.   //
  79. end;
  80.  
  81. procedure T[!ClassName].Dispose(Disposing: Boolean);
  82. begin
  83.   if Disposing then
  84.   begin
  85.     if Components <> nil then
  86.       Components.Dispose();
  87.   end;
  88.   inherited Dispose(Disposing);
  89. end;
  90.  
  91. end.
  92.